<extend name="Base/base" />
<block name="button">
	<button class="btn btn-primary" type="submit" form="form"><i class="fa fa-save"></i> {:L('text_save')}</button>
</block>
<block name="body">
	<if condition="$msg['warning']">
		<div class="alert alert-danger alert-dismissible fade in" role="alert">
		      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
		      {$msg.warning}

		    </div>
	</if>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h4><i class="fa fa-pencil fa-fw"> </i>{$heading_title}</h4>
		</div>
		<div class="panel-body">
			<form action="" method="post" id="form" class="form-horizontal">
				<ul class="nav nav-tabs">
					<li class="active">
						<a href="#tab-general" data-toggle="tab">{:L('text_general')}</a>
					</li>
					<li>
						<a href="#tab-advanced" data-toggle="tab">{:L('text_advanced')}</a>
					</li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active" id="tab-general">
						<ul class="nav nav-tabs">
							<foreach name="languages" key="key" item="language">
								<li class="{$key?'':'active'}">
									<a href="#language{$language.language_id}" data-toggle="tab"><img src="__PUBLIC__/Images/flags/{$language.image}">  {$language.name}</a>
								</li>
							</foreach>
						</ul>
						<div class="tab-content">
							<foreach name="languages" key="key" item="language">
								<div class="tab-pane {$key?'':'active'}" id="language{$language.language_id}">		<div class="form-group required">
					                    <label class="col-sm-2 control-label" for="input-title{$language.language_id}">{:L('text_title')}</label>
					                    <div class="col-sm-10">
					                      <input type="text" name="menu_description[{$language.language_id}][title]" value="{$menu['menu_description'][$language['language_id']]['title']|default=''}" placeholder="{:L('text_title')}" id="iput-title{$language.language_id}" class="form-control">
					                      <if condition="isset($msg['title'][$language['language_id']])">       
					                      	{:danger_msg($msg['title'][$language['language_id']])}
					                      	</if>     
					                    </div>
					                  </div>
								</div>
							</foreach>
						</div>
					</div>
					<div class="tab-pane" id="tab-advanced">
						<div class="form-group required">
							<label class="col-sm-2 control-label" for="input-url">{:L('text_url')}</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="input-url" value="{$menu.url|default=''}" name="url" placeholder="{:L('text_url')}" required="requred">
								<if condition="isset($msg['url'])">
								{:danger_msg($msg['url'])}
								</if>
							</div>							
						</div>
						<div class="form-group">
							<label for="input-pid" class="col-sm-2 control-label">{:L('text_parent')}</label>
							<div class="col-sm-10">
								<select name="pid" id="input-pid" class="form-control">
									<option value="0">{:L('text_root')}</option>
									<foreach name="menus" item="m">
										<option <if condition="isset($menu['pid']) && $m['menu_id'] eq $menu['pid']">selected</if> value="{$m.menu_id}">{$m.html}{$m.title}</option>
									</foreach>
								</select>
							</div>
						</div>			
						<div class="form-group">
							<label class="col-sm-2 control-label" for="input-sort-order">{:L('text_sort_order')}</label>
							<div class="col-sm-10">
								<input type="number" class="form-control" id="input-sort-order" name="sort_order" placeholder="{:L('text_sort_order')}" value="{$menu.sort_order|default=''}">
							</div>							
						</div>
						<div class="form-group">
							<label for="input-icon" class="col-sm-2 control-label">{:L('text_icon')}</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" id="input-icon" name="icon" value="{$menu.icon|default=''}">
							</div>
							<div class="col-sm-2">
								<i class="{$menu.icon|default=''}"></i>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label" for="input-is-show">{:L('text_is_show')}</label>
							<div class="col-sm-10">
								<select class="form-control" name="is_show" id="input-is-show">
									<option value="1">{:L('text_show')}</option>
									<option <if condition="isset($menu['is_show'])&&($menu['is_show'] eq 0)">selected</if> value="0">{:L('text_hide')}</option>
								</select>
							</div>							
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label" for="input-status">{:L('text_status')}</label>
							<div class="col-sm-10">
								<select class="form-control" name="status" id="input-status">
									<option value="1">{:L('text_enabled')}</option>
									<option <if condition="isset($menu['status'])&&($menu['status'] eq 0)">selected</if> value="0">{:L('text_disabled')}</option>
								</select>
							</div>							
						</div>
					</div>
				</div>
			</form>			
		</div>
	</div>
</block>
